<template>
	<u-tabbar v-model="current" :list="list" :before-switch="beforeSwitch" active-color="#27b8a6" icon-size='50'
		:mid-button="true">
	</u-tabbar>
</template>

<script>
	export default {
		props: {
			current: {
				type: String | Number,
				default: 0
			}
		},
		data() {
			return {
				list: [{
						pagePath: "/pages/index/index",
						text: "首页",
						iconPath: require("@/static/img/tabbar/home.png"),
						selectedIconPath: require("@/static/img/tabbar/homeActive.png")
					},
					{
						pagePath: "/pages/applyfor/applyfor",
						text: "号源列表",
						iconPath: require("@/static/img/tabbar/activity.png"),
						selectedIconPath: require("@/static/img/tabbar/activityActive.png"),
						midButton: true,
					},
					{
						pagePath: "/pages/my/index",
						text: "我的",
						iconPath: require("@/static/img/tabbar/my.png"),
						selectedIconPath: require("@/static/img/tabbar/myActive.png"),
					}
				],
			}
		},
		methods: {
			beforeSwitch(index) {
				uni.navigateTo({
					url: this.list[index].pagePath
				})
			}
		}
	}
</script>

<style>
</style>